class calculator{
public static void leap(int year){
	if((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))
		System.out.println(year+" is leap year");
	else
		System.out.println(year+" is not a leap year");

}
public static void evn(int num){
	System.out.println((num%2==0)? "even number": "odd number");
}
public static boolean isPrime(int num){
        for(int i=2; i<num; i++){
           if(num%i == 0){
               return false; 
           }
	}
}
public static void fib(int num){
	int fib=0,fib1=0,fib2=1;
	for(int i=1;i<=num;i++)
	{
	  System.out.printl(fib+" ");
	  fib1=fib2;
	  fib2=fib;
	  fib=fib1+fib2;
	}
 }
public static int max(double n1,double n2){
	if(n1>n2)
	return n1;
	else
	return n2;
}
public static double max(int n1,int n2){
	return (n1>n2) ? n1 : n2;
}
public static void exp(){
	//string to integer conversion
	String emp="e1";
	int intvalue=Integer.parseInt(emp);
	System.out.println("string to integer"+intvalue);

	//string to double conversion
	String sal="150000.56";
	double doubleval=Double.parseDouble(sal);
	System.out.println("string to double"+doubleval);
	
	//radius experiments
	int rad=5;
	if(rad>=0){
	double area=rad*rad*3.142;
	System.out.println("the area of the circle is "+area);
	}

	//case for float
	float status=2.345;
	switch(status){
	case 2.135: System.out.println("first float case");
	    break;
	case 2.234: System.out.println("second float case");
	    break;
	case 2.345: System.out.println("third flaot case");
	    break;
	default:System.out.println("invalid choice");
	}

	//exp in switch
	char ch='a';
	switch(ch){
	case 'a':System.out.println(ch);
	case 'b':System.out.println(ch);
	case 'c':System.out.println(ch);
	}

	
}
public static void main(String[] args)
{
	System.out.println(leap(2013));
	//even or odd
	System.out.println("11 is "+evn(11));
	System.out.println("10 is "+evn(10));
	//print 10 times
	int i=1;
	while(i<=10){
	System.out.println("I WILL PRACTICE EVERYDAY\n");
	i++;
	}
	
	//prime or not
	for(int i1=13;i<15;i++){
		if(isprime(i1))
		System.out.println(i1+" is a prime number\n");
		else
		System.out.println(i1+" is not a prime number\n");
	}
	//fibonacii series
	System.out.println(fib(10));
	//max of 2 int and double
	System.out.println("larger no among 10 and 20 is :"+max(10,20));
	System.out.println("larger no among 10.254678 and 20.254678 is :"+max(10.25678,20.254678));
	System.out.println(exp());
}
}




